<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:composition xmlns:ui="http://java.sun.com/jsf/facelets"
                xmlns:c="http://java.sun.com/jsp/jstl/core"
                xmlns:f="http://java.sun.com/jsf/core"
                xmlns:h="http://java.sun.com/jsf/html"
                xmlns:p="http://primefaces.prime.com.tr/ui"
                template="./../template/WorkspaceTemplate.xhtml">

    <ui:define name="top">

    </ui:define>

    <ui:define name="left">

    </ui:define>

    <ui:define name="right">

    </ui:define>

    <ui:define name="content">
        <p:panel header="Transaction Status">
            <h:form>
                <h:outputText value="#{sqManagerBean.result}"/>
            </h:form>
        </p:panel>

        <p:panel header="Upload Request for Sales Quotation File">
            <h:form id="displayedImg">
                <p:panel header="Uploaded File" rendered="#{fileUploadManagerBean.renderUploadedDocFile()}">
                    <p:graphicImage value="#{facesContext.externalContext.requestContextPath}/../displayImage?id=#{fileUploadManagerBean.returnUploadedDocFileId()}" 
                                    height="1300" width="700"/>
                </p:panel>
            </h:form>
            <h:form enctype="multipart/form-data" prependId="false">
                <p:growl id="uploadMessages" showDetail="true"/>
                <p:messages id="msg" showDetail="true"/>
                <p:fileUpload update="uploadMessages,msg,displayedImg" 
                              fileUploadListener="#{fileUploadManagerBean.handleFileUploadSQ}"
                              widgetVar="uploader"
                              cancelImage="/images/cancel.png" customUI="true"
                              sizeLimit="2097152" width="180"
                              label="Upload" 
                              allowTypes="*.jpg;*.png;*.gif" 
                              description="Images"/>  
                <p:commandButton value="Click here to Upload" ajax="true" action="#{fileUploadManagerBean.passResult(sqManagerBean.result)}" oncomplete="uploader.upload()"/>
            </h:form>
        </p:panel>
    </ui:define>

    <ui:define name="bottom">

    </ui:define>

</ui:composition>
